package com.vitabuybuy.tv.ui.mine.talent.task.adapter

import androidx.recyclerview.widget.RecyclerView
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.ItemPic2Binding
import com.vitabuybuy.tv.databinding.ItemTaskGoodsBinding
import com.vitabuybuy.tv.dto.TaskPoolDetailDto
import com.library.common.base.BindRecycAdapter

class TaskGoodAdapter(private val isShowCopyLink:Boolean) :
    BindRecycAdapter<ItemTaskGoodsBinding, TaskPoolDetailDto.ProductListBean>() {
    override fun onBindViewHolder(
        mBinding: ItemTaskGoodsBinding,
        itemData: TaskPoolDetailDto.ProductListBean,
        holder: RecyclerView.ViewHolder,
        position: Int
    ) {
        mBinding.isShowCopyLink = isShowCopyLink
        mBinding.itemData = itemData
        mBinding.btnCopyLink.setOnClickListener {
            itemCopyLinkListener.invoke(position)
        }
    }

    override fun normalViewId(viewType: Int): Int {
        return R.layout.item_task_goods
    }

    lateinit var itemCopyLinkListener: (position: Int) -> Unit
}
